package cn.tedu.review;

public class ReviewOOP2 {
    public static void main(String[] args) {
        new Cat();
        Cat c=new Cat("旺财",1,10.8);
    }
}
class Cat{
    static{
        System.out.println("静态代码块");
    }
    {
        System.out.println("我是构造代码块");
    }
    String name;
    int id;
    double price;
    public Cat(){
        System.out.println("无参构造");
    }

    public Cat(String name, int id, double price) {
        System.out.println("全参构造");
        this.name = name;
        this.id = id;
        this.price = price;
    }
    public void eat(){
        System.out.println("局部代码块");
    }
}